package com.kelvin.paopao.api;


import com.kelvin.paopao.api.responseBean.CheckTalkModel;
import com.kelvin.paopao.api.responseBean.CommonListResponse;
import com.kelvin.paopao.api.responseBean.DatePersonModel;
import com.kelvin.paopao.api.responseBean.KefuModel;
import com.kelvin.paopao.api.responseBean.LocationPickModel;
import com.kelvin.paopao.api.responseBean.NearByPersonModel;
import com.kelvin.paopao.api.responseBean.PersonPhotoModel;
import com.kelvin.paopao.api.responseBean.TagModel;
import com.kelvin.paopao.api.responseBean.TalkPriceModel;
import com.kelvin.paopao.api.responseBean.UserDetailModel;
import com.kelvin.paopao.api.responseBean.UserGz;
import com.kelvin.paopao.api.responseBean.UserMoneyBean;
import com.kelvin.paopao.api.responseBean.VipPriceModel;
import com.kelvin.paopao.api.responseBean.WalletDetailModel;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * Created by kelvin on 2017/05/05.
 * 用户相关API 接口
 */
public interface IUsersApi {
    /**
     * 更新当前地理位置
     *
     * @param user_lng
     * @param user_lat
     * @param type
     * @return
     */
    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse> updateLocation(@Field("user_lat") String user_lng, @Field("user_lng") String user_lat,
                                                  @Field("type") String type, @Field("user_id") String user_id);

    /**
     * 获取附近的人
     *
     * @param user_lng
     * @param user_lat
     * @param type
     * @param page_index
     * @param user_sex
     * @return
     */
    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse<NearByPersonModel>> getNearPerson(@Field("user_lng") String user_lng, @Field("user_lat") String user_lat, @Field("type") String type
            , @Field("page_index") String page_index, @Field("user_sex") String user_sex,
                                                                    @Field("user_shengao") String user_shengao,
                                                                    @Field("user_tizhong") String user_tizhong,
                                                                    @Field("user_Label") String user_Label, @Field("user_type")
                                                                            String user_type);

    /**
     * 注册接口
     *
     * @param user_sex
     * @param user_id
     * @param user_name
     * @param type
     * @param user_pwd
     * @param user_tel
     * @param user_headimg
     * @return
     */
    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse> register(@Field("user_sex") String user_sex, @Field("user_id") String user_id,
                                            @Field("user_name") String user_name, @Field("type") String type,
                                            @Field("user_pwd") String user_pwd, @Field("user_tel") String user_tel,
                                            @Field("user_headimg") String user_headimg, @Field("user_province") String user_province,
                                            @Field("user_city") String user_city, @Field("user_age") String user_age
            , @Field("code") String code);


    /**
     * 登录接口
     *
     * @param type
     * @param user_pwd
     * @param user_id
     * @return
     */
    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse<UserDetailModel>> login(@Field("type") String type, @Field("user_pwd") String user_pwd,
                                                          @Field("user_id") String user_id, @Field("weixin_id") String weixin_id);

    /**
     * 获取用户详情
     *
     * @param type
     * @param user_no
     * @return
     */
    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse<UserDetailModel>> getUserDetail(@Field("type") String type, @Field("user_no") String user_no);

    /**
     * 关注用户
     */
    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse> focus(@Field("type") String type, @Field("touserno") String touserno,
                                         @Field("fromuserno") String fromuserno, @Field("states") String states);


    /**
     * 取消關注
     *
     * @param type
     * @param touserno
     * @param fromuserno
     * @param states
     * @return
     */
    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse> unfocus(@Field("type") String type, @Field("touserno") String touserno,
                                           @Field("fromuserno") String fromuserno, @Field("states") String states);


    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse<UserGz>> checkFocus(@Field("type") String type, @Field("touserno") String touserno,
                                                      @Field("fromuserno") String fromuserno);


    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse> updateInfo(@Field("type") String type, @Field("user_name") String user_name, @Field("user_age") String user_age,
                                              @Field("user_qianming") String user_qianming, @Field("user_zhiye") String user_zhiye,
                                              @Field("user_tizhong") String user_tizhong, @Field("user_shengao") String user_shengao,
                                              @Field("user_province") String user_province, @Field("user_city") String user_city, @Field("user_id") String user_id
            , @Field("user_ganqing") String user_ganqing, @Field("user_Label") String user_label);


    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse> addPersonPhoto(@Field("type") String type, @Field("user_img") String user_img,
                                                  @Field("user_no") String user_no);

    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse> removePersonPhoto(@Field("type") String type, @Field("id") String id,
                                                     @Field("user_no") String user_no);


    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse<PersonPhotoModel>> getPersonPhoto(@Field("type") String type,
                                                                    @Field("user_no") String user_no);

    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse<DatePersonModel>> getFriend(@Field("type") String type,
                                                              @Field("user_no") String user_no);


    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse> recharge(@Field("type") String type,
                                            @Field("user_no") String user_no, @Field("paymoney") String paymoney);

    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse<UserMoneyBean>> getMoney(@Field("type") String type,
                                                           @Field("user_no") String user_no);

    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse> becomeVIP(@Field("type") String type,
                                             @Field("user_no") String user_no,
                                             @Field("vipId") String vipId);

    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse<VipPriceModel>> getVipPrice(@Field("type") String type,
                                                              @Field("user_no") String user_no);

    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse<WalletDetailModel>> getAccount(@Field("type") String type, @Field("account_type")
            String account_type, @Field("user_no") String user_no);


    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse<LocationPickModel>> getLocationPick
            (@Field("type") String type, @Field("user_no") String user_no);

    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse> addLocationPick
            (@Field("type") String type, @Field("user_no") String user_no, @Field("address") String address,
             @Field("tel") String tel, @Field("username") String username, @Field("ifdefault") String ifdefault,
             @Field("lname") String lname, @Field("lat") String lat, @Field("lng") String lng);


    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse<CheckTalkModel>> checkTalk
            (@Field("type") String type, @Field("fromuser_no") String fromuser_no,
             @Field("touser_no") String touser_no);

    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse<TalkPriceModel>> getTalkMoney
            (@Field("type") String type, @Field("user_no") String user_no);

    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse> payTalk
            (@Field("type") String type, @Field("fromuser_no") String fromuser_no,
             @Field("touser_no") String touser_no, @Field("hours") String hours);


    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse> setTalkMoney
            (@Field("type") String type, @Field("user_no") String user_no,
             @Field("user_talk_price") String user_talk_price);


    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse> resetPwd
            (@Field("type") String type, @Field("mobile") String mobile,
             @Field("code") String code, @Field("pwd") String pwd);

    /*
    * 获取验证码
    */
    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse> getValidation(@Field("type") String type,
                                                 @Field("mobile") String mobile, @Field("types") String types);


    /*
    * 获取标签
    */
    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse<TagModel>> getLabelInfo(@Field("type") String type);


    /*
    * 获取客服
    */
    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse<KefuModel>> getKefu(@Field("type") String type);

    /*
    * 判断是否有注册
    */
    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse> checkPhone(@Field("type") String type, @Field("user_tel")
            String user_tel);

    /*
   * 设置个人的配送价格
   */
    @FormUrlEncoded
    @POST("users.aspx")
    Observable<CommonListResponse> setPsPrice(@Field("type") String type, @Field("user_no")
            String user_no, @Field("user_ps_price") String ps_price);
}
